package service.Impl;

import dao.mapper.WishListMapper;
import org.apache.ibatis.session.SqlSession;
import service.IWishListService;
import utils.SqlSessionUtil;
import vo.WishList;

public class IWishListServiceImpl implements IWishListService {
    SqlSession sqlSession = new SqlSessionUtil().sqlSession;
    WishListMapper wishListMapper = sqlSession.getMapper(WishListMapper.class);
    @Override
    public void addWishList(WishList wishList) {
        wishListMapper.addWishList(wishList);
        sqlSession.commit();
    }

    @Override
    public WishList getWishListByUserId(int userId) {
        WishList wishList = wishListMapper.getWishListByUserId(userId);
        return wishList;
    }
}
